#coding=utf-8
'''
Created on 2016年3月2日
'''
__author__ = 'chenjian'

import zmq  
import time  
  
context = zmq.Context()  
socket = context.socket(zmq.REP)  
socket.bind("tcp://*:5555")  
  
while True:  
    #  Wait for next request from client  
    message = socket.recv()  
    print "Received request: ", message  
  
    #  Do some 'work'  
    time.sleep (1)        #   Do some 'work'  
  
    #  Send reply back to client  
    socket.send("World")  